package com.easygoods.dao;

import com.easygoods.base.BaseDao;
import com.easygoods.entity.GoodsSpu;
import com.easygoods.entityex.GoodsSpuEx;
import com.easygoods.response.SpuShareResponse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by 许崇雷 on 2019-01-02.
 */
@Repository
public interface GoodsSpuDao extends BaseDao<GoodsSpu> {
    List<GoodsSpuEx> findSpuListByCategoryId(@Param("categoryId") String categoryId, RowBounds rowBounds);

    List<GoodsSpuEx> findSpuListByKeyword(@Param("keyword") String keyword, RowBounds rowBounds);

    List<GoodsSpuEx> findMySpuListByKeyword(@Param("storeId") String storeId, @Param("keyword") String keyword, RowBounds rowBounds);

    GoodsSpuEx findSpuById(@Param("spuId") String spuId);

    SpuShareResponse findShareInfo(@Param("spuId") String spuId);

    //根据store_id查询收藏的spu列表
    List<GoodsSpuEx> getSpuListByStoreId(@Param("storeId") String storeId, RowBounds rowBounds);

    //根据orderId查询最小退款天数
    int getMinReturnDaysByOrderId(@Param("orderId") String orderId);
}
